export default class GroupInfo {
  constructor ({ visible, dialogTitle, loading, list, columns, submitBtnLoading }) {
    this.visible = visible ?? false;
    this.dialogTitle = dialogTitle ?? '';
    this.tableInfo = {
      loading: loading ?? false,
      list: list ?? [],
      columns: columns ?? []
    }
    this.submitBtnLoading = submitBtnLoading ?? false;
  }
  setTableData (list) {
    this.tableInfo.list = list;
  }
  getTableData () {
    return this.tableInfo.list;
  }
  setTableColumns (columns) {
    this.tableInfo.columns = columns;
  }
  changeVisible (visible) {
    this.visible = visible
  }
  changeLoading (state) {
    this.tableInfo.loading = state;
  }
  setRowProp (index, key, val) {
    this.tableInfo.list[index][key] = val;
  }
  changeSubmitBtnLoading (state) {
    this.submitBtnLoading = state;
  }
}
